package com.sf.ams.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sf.ams.biz.IUpdateDataBiz;
import com.sf.ams.entity.Response;
import com.sf.ams.entity.SystemInfo;
import com.sf.ams.logging.CommonLogging;

/**
 * 描述：
 * 
 * <pre>HISTORY
 * ****************************************************************************
 *  ID   DATE           PERSON          REASON
 *  1    2017年10月10日      Simba.Hua         Create
 * ****************************************************************************
 * </pre>
 * @author Simba.Hua
 */
@RestController
@RequestMapping("/updateData")
public class UpdateDataController {
	private @Autowired IUpdateDataBiz updateDataBiz;
	@RequestMapping("/updateEnvironment")
	@CommonLogging(content = "更新环境")
	public Response updateEnvironment(@RequestBody SystemInfo system){
		return updateDataBiz.updateEnvironment(system);
	}
	
	@RequestMapping("/saveSystem")
	@CommonLogging(content = "新增系统")
	public Response saveSystem(SystemInfo system){
		return updateDataBiz.saveSystem(system);
	}
	@RequestMapping("editSystem")
	@CommonLogging(content = "更新系统")
	public Response editSystem(SystemInfo system) {
		return updateDataBiz.editSystem(system);
	}
	
	@RequestMapping("deleteSystemEnvironment")
	@CommonLogging(content = "删除环境")
	public Response deleteSystemEnvironment(@RequestBody SystemInfo system) {
		return updateDataBiz.deleteEnvironment(system);
	}
	@RequestMapping("deleteSystem")
	@CommonLogging(content = "删除系统")
	public Response deleteSystem(String systemCode) {
		return updateDataBiz.deleteSystem(systemCode);
	}
}
